package org.hentai.tri.grpc.server;

import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.ServiceConfig;
import org.apache.dubbo.config.bootstrap.DubboBootstrap;
import org.hentai.tri.grpc.Hentai;
import org.hentai.tri.grpc.service.HentaiTriImpl;

public class HentaiTriOpServer {

    public static void main(String[] args) throws InterruptedException {
        ServiceConfig<Hentai> service = new ServiceConfig<>();
        service.setInterface(Hentai.class);
        service.setRef(new HentaiTriImpl());

        DubboBootstrap bootstrap = DubboBootstrap.getInstance();
        bootstrap.application(new ApplicationConfig("hentai-tri-stub-server"))
                .registry(new RegistryConfig("N/A"))
                .protocol(new ProtocolConfig(CommonConstants.TRIPLE, 50053))
                .service(service)
                .start().await();
    }

}
